﻿<UserControl x:Class="HSE.Xtsz"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" 
    xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
    xmlns:ee="http://schemas.microsoft.com/expression/2010/effects"
    xmlns:System="clr-namespace:System;assembly=mscorlib"

    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <UserControl.Resources>
        <ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
            <StackPanel  Orientation="Horizontal"  Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
                <i:Interaction.Behaviors>
                    <ei:FluidMoveBehavior AppliesTo="Children" Tag="DataContext">
                        <ei:FluidMoveBehavior.EaseX>
                            <BackEase EasingMode="EaseInOut" Amplitude="0.5"/>
                        </ei:FluidMoveBehavior.EaseX>
                    </ei:FluidMoveBehavior>
                </i:Interaction.Behaviors>
            </StackPanel>
        </ItemsPanelTemplate>
        <ItemsPanelTemplate x:Key="ItemsPanelTemplate2">
            <StackPanel  Orientation="Vertical"  Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
                <i:Interaction.Behaviors>
                    <ei:FluidMoveBehavior AppliesTo="Children" Tag="DataContext">
                        <ei:FluidMoveBehavior.EaseX>
                            <BackEase EasingMode="EaseInOut" Amplitude="0.5"/>
                        </ei:FluidMoveBehavior.EaseX>
                    </ei:FluidMoveBehavior>
                </i:Interaction.Behaviors>
            </StackPanel>
        </ItemsPanelTemplate>

        <ControlTemplate x:Key="ValidationToolTipTemplate">
            <Grid x:Name="Root" Margin="5,0" Opacity="0" RenderTransformOrigin="0,0">
                <Grid.RenderTransform>
                    <TranslateTransform x:Name="xform" X="-25"/>
                </Grid.RenderTransform>
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="OpenStates">
                        <VisualStateGroup.Transitions>
                            <VisualTransition GeneratedDuration="0"/>
                            <VisualTransition GeneratedDuration="0:0:0.2" To="Open">
                                <Storyboard>
                                    <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetProperty="X" Storyboard.TargetName="xform">
                                        <DoubleAnimation.EasingFunction>
                                            <BackEase Amplitude=".3" EasingMode="EaseOut"/>
                                        </DoubleAnimation.EasingFunction>
                                    </DoubleAnimation>
                                    <DoubleAnimation Duration="0:0:0.2" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root"/>
                                </Storyboard>
                            </VisualTransition>
                        </VisualStateGroup.Transitions>
                        <VisualState x:Name="Closed">
                            <Storyboard>
                                <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root"/>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Open">
                            <Storyboard>
                                <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="X" Storyboard.TargetName="xform"/>
                                <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root"/>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <Border Background="#052A2E31" CornerRadius="5" Margin="4,4,-4,-4"/>
                <Border Background="#152A2E31" CornerRadius="4" Margin="3,3,-3,-3"/>
                <Border Background="#252A2E31" CornerRadius="3" Margin="2,2,-2,-2"/>
                <Border Background="#352A2E31" CornerRadius="2" Margin="1,1,-1,-1"/>
                <Border Background="#FFDC000C" CornerRadius="2"/>
                <Border CornerRadius="2">
                    <TextBlock Foreground="White" MaxWidth="250" Margin="8,4,8,4" TextWrapping="Wrap" Text="{Binding (Validation.Errors)[0].ErrorContent}" UseLayoutRounding="false"/>
                </Border>
            </Grid>
        </ControlTemplate>
        <Style x:Key="ListBoxStyle1" TargetType="ListBox">
            <Setter Property="Padding" Value="1"/>
            <Setter Property="Background" Value="#FFFFFFFF"/>
            <Setter Property="Foreground" Value="#FF000000"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="IsTabStop" Value="False"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="TabNavigation" Value="Once"/>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFA3AEB9" Offset="0"/>
                        <GradientStop Color="#FF8399A9" Offset="0.375"/>
                        <GradientStop Color="#FF718597" Offset="0.375"/>
                        <GradientStop Color="#FF617584" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListBox">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="ValidationStates">
                                    <VisualState x:Name="Valid"/>
                                    <VisualState x:Name="InvalidUnfocused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="InvalidFocused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen" Storyboard.TargetName="validationTooltip">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <System:Boolean>True</System:Boolean>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>

                            </VisualStateManager.VisualStateGroups>
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
                                <ScrollViewer x:Name="ScrollViewer" BorderBrush="Transparent" BorderThickness="0" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" TabNavigation="{TemplateBinding TabNavigation}">
                                    <ItemsPresenter>
                                        <i:Interaction.Behaviors>
                                            <ei:FluidMoveBehavior>
                                                <ei:FluidMoveBehavior.EaseY>
                                                    <SineEase EasingMode="EaseOut"/>
                                                </ei:FluidMoveBehavior.EaseY>
                                                <ei:FluidMoveBehavior.EaseX>
                                                    <SineEase EasingMode="EaseOut"/>
                                                </ei:FluidMoveBehavior.EaseX>
                                            </ei:FluidMoveBehavior>
                                        </i:Interaction.Behaviors>
                                    </ItemsPresenter>
                                </ScrollViewer>
                            </Border>
                            <Border x:Name="ValidationErrorElement" BorderBrush="#FFDB000C" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2" Visibility="Collapsed">
                                <ToolTipService.ToolTip>
                                    <ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}">
                                        <ToolTip.Triggers>
                                            <EventTrigger RoutedEvent="Canvas.Loaded">
                                                <BeginStoryboard>
                                                    <Storyboard>
                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="validationTooltip">
                                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                                <DiscreteObjectKeyFrame.Value>
                                                                    <System:Boolean>true</System:Boolean>
                                                                </DiscreteObjectKeyFrame.Value>
                                                            </DiscreteObjectKeyFrame>
                                                        </ObjectAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </BeginStoryboard>
                                            </EventTrigger>
                                        </ToolTip.Triggers>
                                    </ToolTip>
                                </ToolTipService.ToolTip>
                                <Grid Background="Transparent" HorizontalAlignment="Right" Height="10" Margin="0,-4,-4,0" VerticalAlignment="Top" Width="10">
                                    <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z" Fill="#FFDC000C" Margin="-1,3,0,0"/>
                                    <Path Data="M 0,0 L2,0 L 8,6 L8,8" Fill="#ffffff" Margin="-1,3,0,0"/>
                                </Grid>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ListBoxItemStyle1" TargetType="ListBoxItem">
            <Setter Property="Padding" Value="3"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="TabNavigation" Value="Local"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListBoxItem">
                        <StackPanel x:Name="stackPanel" Orientation="Vertical" Width="525" VerticalAlignment="Bottom" RenderTransformOrigin="0.5,0.5">
                            <StackPanel.RenderTransform>
                                <CompositeTransform/>
                            </StackPanel.RenderTransform>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:0.4"/>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <!--<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="image" d:IsOptimized="True">
                                                <DoubleAnimation.EasingFunction>
                                                    <BackEase EasingMode="EaseOut"/>
                                                </DoubleAnimation.EasingFunction>
                                            </DoubleAnimation>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="image" d:IsOptimized="True">
                                                <DoubleAnimation.EasingFunction>
                                                    <BackEase EasingMode="EaseOut"/>
                                                </DoubleAnimation.EasingFunction>
                                            </DoubleAnimation>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" d:IsOptimized="True"/>-->
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="contentPresenter"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="SelectionStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:0.4"/>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Unselected"/>
                                    <VisualState x:Name="Selected">
                                        <Storyboard>
                                            <!--<DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True">
                                                <DoubleAnimation.EasingFunction>
                                                    <PowerEase EasingMode="EaseOut"/>
                                                </DoubleAnimation.EasingFunction>
                                            </DoubleAnimation>
                                            <DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True">
                                                <DoubleAnimation.EasingFunction>
                                                    <PowerEase EasingMode="EaseOut"/>
                                                </DoubleAnimation.EasingFunction>
                                            </DoubleAnimation>
                                            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="-8" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationZ)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="-8" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationZ)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>-->
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="SelectedUnfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="LayoutStates" ei:ExtendedVisualStateManager.UseFluidLayout="True">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition/>
                                        <VisualTransition GeneratedDuration="0:0:1" To="BeforeUnloaded">
                                            <ei:ExtendedVisualStateManager.TransitionEffect>
                                                <ee:BlindsTransitionEffect></ee:BlindsTransitionEffect>
                                                <!--<ee:SlideInTransitionEffect SlideDirection="RightToLeft"/>-->
                                            </ei:ExtendedVisualStateManager.TransitionEffect>
                                            <VisualTransition.GeneratedEasingFunction>
                                                <BackEase EasingMode="EaseInOut" Amplitude="2"/>
                                            </VisualTransition.GeneratedEasingFunction>
                                        </VisualTransition>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="AfterLoaded">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0:0:2" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="stackPanel" d:IsOptimized="True">
                                                <DoubleAnimation.EasingFunction>
                                                    <BackEase Amplitude="0.5" EasingMode="EaseOut"/>
                                                </DoubleAnimation.EasingFunction>
                                            </DoubleAnimation>
                                            <DoubleAnimation Duration="0:0:2.3" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="stackPanel" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="BeforeLoaded">
                                        <Storyboard>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="BeforeUnloaded">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="-500" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="stackPanel" d:IsOptimized="True"/>

                                            <!--<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="stackPanel" d:IsOptimized="True"/>-->
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Grid Background="{TemplateBinding Background}" d:LayoutOverrides="Width">
                                <!--<Rectangle x:Name="rectangle" Margin="3" RadiusY="1" RadiusX="1" StrokeStartLineCap="Square" StrokeEndLineCap="Square" StrokeThickness="1" Fill="#B2FFFFFF" Opacity="0" RenderTransformOrigin="0.5,0.5">
                                    <Rectangle.RenderTransform>
                                        <CompositeTransform/>
                                    </Rectangle.RenderTransform>
                                    <Rectangle.Projection>
                                        <PlaneProjection/>
                                    </Rectangle.Projection>
                                    <Rectangle.Effect>
                                        <BlurEffect Radius="16"/>
                                    </Rectangle.Effect>
                                </Rectangle>-->
                                <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RenderTransformOrigin="0.5,0.5">
                                    <ContentPresenter.Projection>
                                        <PlaneProjection/>
                                    </ContentPresenter.Projection>
                                    <ContentPresenter.RenderTransform>
                                        <CompositeTransform/>
                                    </ContentPresenter.RenderTransform>
                                </ContentPresenter>
                                <!--<Rectangle x:Name="FocusVisualElement" RadiusY="1" RadiusX="1" Stroke="#FF6DBDD1" StrokeThickness="1" Visibility="Collapsed"/>
                                <Image x:Name="image" Source="silverlight.png" Stretch="Fill" Height="34" Margin="0,0,10,10" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="34" RenderTransformOrigin="0.5,0.5">
                                    <Image.RenderTransform>
                                        <CompositeTransform ScaleX="0" ScaleY="0"/>
                                    </Image.RenderTransform>
                                </Image>-->
                            </Grid>
                            <!--<Path x:Name="path" Data="M3,120 L184.66663,120" Height="1" Margin="3,0,3,5" Stretch="Fill" StrokeThickness="1" UseLayoutRounding="False" StrokeDashArray="2 2" StrokeDashCap="Round" StrokeStartLineCap="Square" StrokeEndLineCap="Square" Opacity="0">
                                <Path.Stroke>
                                    <LinearGradientBrush EndPoint="1.197,0.5" StartPoint="-0.158,0.528">
                                        <GradientStop Color="#FF6DBDD1" Offset="0.5"/>
                                        <GradientStop Color="Transparent" Offset="1"/>
                                        <GradientStop Color="#01FFFFFF"/>
                                    </LinearGradientBrush>
                                </Path.Stroke>
                            </Path>-->
                        </StackPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="ListBoxItemStyle3" TargetType="ListBoxItem">
            <Setter Property="Padding" Value="3"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="TabNavigation" Value="Local"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListBoxItem">
                        <Grid x:Name="grid" Background="{TemplateBinding Background}">
                            <VisualStateManager.CustomVisualStateManager>
                                <ei:ExtendedVisualStateManager/>
                            </VisualStateManager.CustomVisualStateManager>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="LayoutStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:0.5">
                                            <ei:ExtendedVisualStateManager.TransitionEffect>
                                                <ee:PixelateTransitionEffect/>
                                            </ei:ExtendedVisualStateManager.TransitionEffect>
                                        </VisualTransition>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="BeforeLoaded">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid">
                                                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="AfterLoaded"/>
                                    <VisualState x:Name="BeforeUnloaded">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid">
                                                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>


        <Style x:Key="ListBoxItemStyle2" TargetType="ListBoxItem">
            <Setter Property="Padding" Value="3"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="TabNavigation" Value="Local"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListBoxItem">
                        <StackPanel x:Name="stackPanel" Orientation="Vertical" Width="110" VerticalAlignment="Bottom" RenderTransformOrigin="0.5,0.5">
                            <StackPanel.RenderTransform>
                                <CompositeTransform/>
                            </StackPanel.RenderTransform>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:0.4"/>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <!--<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="image" d:IsOptimized="True">
                                                <DoubleAnimation.EasingFunction>
                                                    <BackEase EasingMode="EaseOut"/>
                                                </DoubleAnimation.EasingFunction>
                                            </DoubleAnimation>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="image" d:IsOptimized="True">
                                                <DoubleAnimation.EasingFunction>
                                                    <BackEase EasingMode="EaseOut"/>
                                                </DoubleAnimation.EasingFunction>
                                            </DoubleAnimation>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" d:IsOptimized="True"/>-->
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="contentPresenter"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="SelectionStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:0.4"/>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Unselected"/>
                                    <VisualState x:Name="Selected">
                                        <Storyboard>
                                            <!--<DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True">
                                                <DoubleAnimation.EasingFunction>
                                                    <PowerEase EasingMode="EaseOut"/>
                                                </DoubleAnimation.EasingFunction>
                                            </DoubleAnimation>
                                            <DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True">
                                                <DoubleAnimation.EasingFunction>
                                                    <PowerEase EasingMode="EaseOut"/>
                                                </DoubleAnimation.EasingFunction>
                                            </DoubleAnimation>
                                            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="-8" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationZ)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="-8" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationZ)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
                                            <DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>-->
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="SelectedUnfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="LayoutStates" ei:ExtendedVisualStateManager.UseFluidLayout="True">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition/>
                                        <VisualTransition GeneratedDuration="0:0:1" To="BeforeUnloaded">
                                            <ei:ExtendedVisualStateManager.TransitionEffect>
                                                <ee:BlindsTransitionEffect></ee:BlindsTransitionEffect>
                                                <!--<ee:SlideInTransitionEffect SlideDirection="RightToLeft"/>-->
                                            </ei:ExtendedVisualStateManager.TransitionEffect>
                                            <VisualTransition.GeneratedEasingFunction>
                                                <BackEase EasingMode="EaseInOut" Amplitude="2"/>
                                            </VisualTransition.GeneratedEasingFunction>
                                        </VisualTransition>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="AfterLoaded">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0:0:2" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="stackPanel" d:IsOptimized="True">
                                                <DoubleAnimation.EasingFunction>
                                                    <BackEase Amplitude="0.5" EasingMode="EaseOut"/>
                                                </DoubleAnimation.EasingFunction>
                                            </DoubleAnimation>
                                            <DoubleAnimation Duration="0:0:2.3" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="stackPanel" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="BeforeLoaded">
                                        <Storyboard>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="BeforeUnloaded">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="-500" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="stackPanel" d:IsOptimized="True"/>

                                            <!--<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="stackPanel" d:IsOptimized="True"/>-->
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Grid Background="{TemplateBinding Background}" d:LayoutOverrides="Width">
                                <!--<Rectangle x:Name="rectangle" Margin="3" RadiusY="1" RadiusX="1" StrokeStartLineCap="Square" StrokeEndLineCap="Square" StrokeThickness="1" Fill="#B2FFFFFF" Opacity="0" RenderTransformOrigin="0.5,0.5">
                                    <Rectangle.RenderTransform>
                                        <CompositeTransform/>
                                    </Rectangle.RenderTransform>
                                    <Rectangle.Projection>
                                        <PlaneProjection/>
                                    </Rectangle.Projection>
                                    <Rectangle.Effect>
                                        <BlurEffect Radius="16"/>
                                    </Rectangle.Effect>
                                </Rectangle>-->
                                <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RenderTransformOrigin="0.5,0.5">
                                    <ContentPresenter.Projection>
                                        <PlaneProjection/>
                                    </ContentPresenter.Projection>
                                    <ContentPresenter.RenderTransform>
                                        <CompositeTransform/>
                                    </ContentPresenter.RenderTransform>
                                </ContentPresenter>
                                <!--<Rectangle x:Name="FocusVisualElement" RadiusY="1" RadiusX="1" Stroke="#FF6DBDD1" StrokeThickness="1" Visibility="Collapsed"/>
                                <Image x:Name="image" Source="silverlight.png" Stretch="Fill" Height="34" Margin="0,0,10,10" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="34" RenderTransformOrigin="0.5,0.5">
                                    <Image.RenderTransform>
                                        <CompositeTransform ScaleX="0" ScaleY="0"/>
                                    </Image.RenderTransform>
                                </Image>-->
                            </Grid>
                            <!--<Path x:Name="path" Data="M3,120 L184.66663,120" Height="1" Margin="3,0,3,5" Stretch="Fill" StrokeThickness="1" UseLayoutRounding="False" StrokeDashArray="2 2" StrokeDashCap="Round" StrokeStartLineCap="Square" StrokeEndLineCap="Square" Opacity="0">
                                <Path.Stroke>
                                    <LinearGradientBrush EndPoint="1.197,0.5" StartPoint="-0.158,0.528">
                                        <GradientStop Color="#FF6DBDD1" Offset="0.5"/>
                                        <GradientStop Color="Transparent" Offset="1"/>
                                        <GradientStop Color="#01FFFFFF"/>
                                    </LinearGradientBrush>
                                </Path.Stroke>
                            </Path>-->
                        </StackPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <DataTemplate x:Name="NoticeTemplate" >
            <Border BorderThickness="0" Height="360" Width="500" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="8" BorderBrush="Black" Margin="0 12 0 0">
                <Image Source="{Binding Image}" ToolTipService.ToolTip="{Binding Notice}" Width="500" Height="360" Margin="0 0 20 0" Stretch="UniformToFill" ></Image>
            </Border>
        </DataTemplate>
        <DataTemplate x:Name="FunctionTemplate" >
            <Border Height="90" Width="90" Background="#FFFAFAFA" BorderThickness="1 1 1 1" BorderBrush="#FFCCCCCC" CornerRadius="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
                <Grid>
                    <StackPanel Orientation="Vertical" Margin="0 10 0 0">
                        <Image Source="{Binding Image}" Width="48" Height="48" Stretch="UniformToFill" ></Image>
                        <TextBlock FontFamily="/HSE;component/Fonts/Fonts.zip#FZDaBiaoSong-B06S" Foreground="#FFB4B4B4" Text="{Binding Notice}" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center" ></TextBlock>
                    </StackPanel>
                    <Border Background="Red" Visibility="{Binding NewVisibility}" CornerRadius="20" Width="20" Height="20" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="-5">
                        <TextBlock Text="{Binding Newnum}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="10"></TextBlock>
                    </Border>
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="rootTemplate">
            <Grid Background="#01424242">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="50"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="MouseLeftButtonDown">
                        <ei:ChangePropertyAction TargetObject="{Binding Mode=OneWay}" PropertyName="IsLiked" Value="False"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
                    <Image Margin="5 0 0 0" Grid.Column="0"  HorizontalAlignment="Left" VerticalAlignment="Center" Source="{Binding Icon}" Width="32" Height="32"></Image>
                    <TextBlock Margin="5 0 0 0" FontFamily="/HSE;component/Fonts/Fonts.zip#FZDaBiaoSong-B06S" Foreground="#FFB4B4B4" FontSize="18" Grid.Column="1" Text="{Binding Name}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="ownrootTemplate">
            <Grid Background="#01424242">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="50"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="MouseLeftButtonDown">
                        <ei:ChangePropertyAction TargetObject="{Binding Mode=OneWay}" PropertyName="IsLiked" Value="True"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
                <Image Margin="5 0 0 0" Grid.Column="0"  HorizontalAlignment="Left" VerticalAlignment="Center" Source="{Binding Icon}" Width="32" Height="32"></Image>
                <TextBlock Margin="5 0 0 0" FontFamily="/HSE;component/Fonts/Fonts.zip#FZDaBiaoSong-B06S" Foreground="#FFB4B4B4" FontSize="18" Grid.Column="1" Text="{Binding Name}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
            </Grid>
        </DataTemplate>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <ImageBrush ImageSource="../Images/bookbackground.png"></ImageBrush>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0" Margin="20 20 0 0" Text="系统管理工具" Foreground="#FF857474" FontSize="29.333" FontFamily="/HSE;component/Fonts/Fonts.zip#FZCuQian-M17S"></TextBlock>

        <ListBox  Grid.Row="1" ItemsSource="{Binding Functions}" HorizontalAlignment="Stretch" VerticalAlignment="Top" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"  Background="Transparent" Margin="20 10 20 0" BorderThickness="0" Style="{StaticResource ListBoxStyle1}" ItemsPanel="{StaticResource ItemsPanelTemplate1}" ItemContainerStyle="{StaticResource ListBoxItemStyle2}" ItemTemplate="{StaticResource FunctionTemplate}" ScrollViewer.HorizontalScrollBarVisibility="Hidden" />
        <Border Margin="20 5 20 5" Grid.Row="2" Height="1" Background="#FF857474"></Border>
        <Grid Grid.Row="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"></RowDefinition>
                <RowDefinition Height="auto"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" Margin="20 20 0 0" Text="权限管理" Foreground="#FF857474" FontSize="29.333" FontFamily="/HSE;component/Fonts/Fonts.zip#FZCuQian-M17S"></TextBlock>
            <TextBlock Grid.Row="1" Grid.Column="0" Margin="20 20 0 0" Text="未赋权限列表" Foreground="#FF857474" FontSize="20" FontFamily="/HSE;component/Fonts/Fonts.zip#FZCuQian-M17S"></TextBlock>
            <TextBlock Grid.Row="1" Grid.Column="1" Margin="20 20 0 0" Text="拥有权限列表" Foreground="#FF857474" FontSize="20" FontFamily="/HSE;component/Fonts/Fonts.zip#FZCuQian-M17S"></TextBlock>
            <ListBox Margin="20" Grid.Row="2" Grid.Column="0" x:Name="rootListBox" ItemsSource="{Binding Roots}" ItemTemplate="{StaticResource rootTemplate}" Foreground="#FFCACACA" Background="#FF333333" FontSize="16" ItemsPanel="{StaticResource ItemsPanelTemplate2}" ItemContainerStyle="{StaticResource ListBoxItemStyle3}" BorderBrush="{x:Null}"/>
            <ListBox Margin="20" Grid.Row="2" Grid.Column="1" x:Name="ownListBox"  ItemsSource="{Binding OwnRoots}" ItemTemplate="{StaticResource ownrootTemplate}" Foreground="#FFCACACA" Background="#FF333333" FontSize="16" ItemsPanel="{StaticResource ItemsPanelTemplate2}" ItemContainerStyle="{StaticResource ListBoxItemStyle3}" BorderBrush="{x:Null}"/>

        </Grid>
    </Grid>
</UserControl>
